---
order: 1
title: Main Module
type: Graphics
group: Particle
label: Graphics/Particle
---

[MainModule](/apis/core/#MainModule) is the primary module of the `ParticleGeneratorModule`, containing the most basic particle generation parameters. Most of these properties are used to control the initial state of newly created particles.

<Image src="https://mdn.alipayobjects.com/huamei_qbugvr/afts/img/A*JUjgTLfiz7kAAAAAAAAAAAAADtKFAQ/original" alt="avatar" style={{ zoom: "50%" }} />

## Properties

You can debug each property in the provided example to better understand and control the particle main module, thereby achieving various complex and beautiful visual effects.

| Property | Description |
| :--- | :--- |
| [duration](/apis/core/#MainModule-duration) | Duration. Determines how long the particle generator runs, in seconds. A longer duration means the particle system will generate more particles, creating a continuous effect. |
| [isLoop](/apis/core/#MainModule-isLoop) | Whether to loop. If set to true, the particle generator will automatically restart after the duration ends, forming a continuous effect like smoke or flowing water. |
| [startDelay](/apis/core/#MainModule-startDelay) | Start delay time. Determines how long the particle generator waits before emitting particles after starting. Useful for achieving effects like fireworks that require a time delay. |
| [startLifetime](/apis/core/#MainModule-startLifetime) | Initial lifetime. Determines how long each particle can survive before disappearing. A longer lifetime means particles will stay on the screen longer. |
| [startSpeed](/apis/core/#MainModule-startSpeed) | Initial speed when particles are first generated. Determines the speed at which particles are emitted. A higher initial speed will cause particles to spread rapidly, like an explosion effect; a lower speed will make particles float slowly, like smoke. |
| [startSize3D](/apis/core/#MainModule-startSize3D) | Whether to specify particle size separately for each axis. Allows setting different sizes for the particle's x, y, and z axes, creating anisotropic particle effects, such as elongated flames. |
| [startSize](/apis/core/#MainModule-startSize) | Initial size when the particle generator first generates particles. Controls the size of each particle. A larger initial size is suitable for simulating large clouds of smoke or flames, while a smaller size is suitable for delicate dust or splashes. |
| [startSizeX](/apis/core/#MainModule-startSizeX) | Initial size along the x-axis when the particle generator first generates particles. |
| [startSizeY](/apis/core/#MainModule-startSizeY) | Initial size along the y-axis when the particle generator first generates particles. |
| [startSizeZ](/apis/core/#MainModule-startSizeZ) | Initial size along the z-axis when the particle generator first generates particles. |
| [startRotation3D](/apis/core/#MainModule-startRotation3D) | Whether to enable 3D particle rotation. Allows particles to rotate in 3D space, increasing their sense of depth and complexity, such as falling leaves in three-dimensional space. |
| [startRotation](/apis/core/#MainModule-startRotation) | Initial rotation when the particle generator first generates particles. Sets the rotation angle at particle emission, suitable for effects where particles need to move in a specific direction, such as directional flames. |
| [startRotationX](/apis/core/#MainModule-startRotationX) | Initial rotation along the x-axis at particle emission. |
| [startRotationY](/apis/core/#MainModule-startRotationY) | Initial rotation along the y-axis at particle emission. |
| [startRotationZ](/apis/core/#MainModule-startRotationZ) | Initial rotation along the z-axis at particle emission. |
| [flipRotation](/apis/core/#MainModule-flipRotation) | Flip rotation. Ranges from 0 to 1, causing some particles to rotate in the opposite direction, increasing the randomness and naturalness of the particle system, suitable for simulating complex motion trajectories. |
| [startColor](/apis/core/#MainModule-startColor) | Initial color. Determines the color of particles, which can be used to simulate effects of different materials, such as the red-orange color of flames or the gray-white color of smoke. |
| [gravityModifier](/apis/core/#MainModule-gravityModifier) | Gravity modifier. Adjusts the extent to which particles are affected by gravity, making them appear more realistic, such as falling raindrops or rising smoke. |
| [simulationSpace](/apis/core/#MainModule-simulationSpace) | Chooses the space in which particles are simulated. Determines whether particles move relative to the world or relative to the generator itself. World space is suitable for stationary effects like smoke; local space is suitable for effects that move with the object, such as flame trails. |
| [simulationSpeed](/apis/core/#MainModule-simulationSpeed) | Simulation speed. Can globally speed up or slow down the movement speed of particles, suitable for slow motion or accelerated effects. |
| [scalingMode](/apis/core/#MainModule-scalingMode) | Scaling mode. Determines how the particle generator handles transformations such as position, rotation, and scaling when emitting particles. Using scalingMode ensures that the transformation relationship between the particle generator and the particles meets expectations. |
| [playOnEnabled](/apis/core/#MainModule-playOnEnabled) | If set to true, the particle generator will automatically start playing on launch. Enabling this option ensures that the particle system starts emitting particles as soon as it is activated, suitable for scenarios where immediate effects are needed. |
| [maxParticles](/apis/core/#MainModule-maxParticles) | Maximum particles. Limits the maximum number of particles in the particle system to prevent performance issues. A larger value is suitable for effects that require a large number of particles, such as dense smoke. |

### Explanation of scalingMode

The scalingMode has the following options:

- **Local**: Particles inherit the local transformation of the particle generator, meaning the particle transformation occurs in the generator's local coordinate system.
- **World**: Particles inherit the global transformation of the particle generator, meaning the particle transformation occurs in the world coordinate system.
- **Hierarchy**: Particles inherit transformations from the entire transformation hierarchy, meaning particles consider transformations of the generator's parent and higher-level transformations.